 {

        var o = require("../UIManager/SafeLoader.js"), i = function () {
        };
        i.prototype = {
            _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
            ctor: function () {
                Global.notificationCenter.on(Global.eventName.GAME_SHOW_COMMTIPS, this.showTipsCallback.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.GAME_SHOW_COMMWAITTING, this.showWaitting.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.GAME_HIDE_COMMWAITTING, this.hideWaitting.bind(this), this),
                    this.hideAdTimes = 0, this.adShowTimes = 0, this.errorCount = 0;
            },
            httpRequest: function (e, t, n, o) {
                cc.sys.platform == cc.sys.WECHAT_GAME ? wx.request({
                    url: e,
                    data: {
                        key: t
                    },
                    success: function (e) {
                        var t = e.data;
                        console.log("httpRequest success params:", t), null == t.error ? n && n(t) : o && o();
                    },
                    fail: function (e) {
                        console.log("httpRequest fail params:", e), o && o();
                    }
                }) : HttpService.getMethodByUrl(e, {
                    data: t
                }, function (e) {
                    console.log("httpRequest success json:", e), null == e.error ? n && n(e) : o && o();
                }.bind(this), function (e) {
                    console.log("httpRequest fail params:", e), o && o();
                }.bind(this));
            },
            getUnit: function (e, t) {
                return Global.roomInfoModel.getPlayModel() == Global.config.playModel.XUEZHAN || Global.roomInfoModel.getPlayModel() == Global.config.playModel.XUELIU ? e ? "JS_13" : Global.config.Unit.Bei : e ? "JS_13b" : Global.config.Unit.Fan;
            },
            onBuyClickForIOS: function () {
                var e = {
                    text: "亲，邀请朋友可获得海量金币！",
                    cancelSp: Global.spriteAtlas.getGoInviteSpf(),
                    cancelText: "去邀请",
                    cancelCallback: function () {
                        Global.UIPopupManager.addPopup("PopupPanel/Panel_InviteFri", function (e) {
                        });
                    },
                    closeCallback: function () {
                        console.log("closeCallback");
                    },
                    needConfirmBtn: !1
                };
                Global.UIPopupManager.alert(e);
            },
            showBanner: function (e, t, n, o) {
                t = void 0 == t ? Global.config.adid : t;
                var i = 266, a = tywx.UserInfo.model;
                a && (a.indexOf("iPhone X") >= 0 ? i = 260 : a.indexOf("iPhone 5") >= 0 ? i = 226 : a.indexOf("iPhone 6") >= 0 ? i = 262 : a.indexOf("iPhone 6 Plus") >= 0 ? i = 268 : a.indexOf("iPhone 7 Plus") >= 0 && (i = 270));
                try {
                    var r = Global.configCdn.getUISwitchConf();
                    if (r && "selectScene" == SceneHelper.getCurSceneName() && this.hideAdTimes < r.hideAdCount) return this.hideAdTimes += 1,
                        void (Global.bannerAd && Global.bannerAd.style && (Global.bannerAd.style.left = .5 * tywx.SystemInfo.wxSystemInfo.screenWidth - i));
                    var s = this;
                    if (!tywx.SystemInfo.wxSystemInfo) return;
                    var l = tywx.SystemInfo.wxSystemInfo.SDKVersion;
                    if (console.log("addBanner compare version:", Global.utils.compareVersion(l, "2.0.4")),
                    Global.utils.compareVersion(l, "2.0.4") <= 0) return;
                    r && r.adShowTimes && s.adShowTimes >= r.adShowTimes ? Global.bannerAd && (Global.bannerAd.destroy(),
                        Global.bannerAd = null, console.log("showBanner: Global.bannerAd.destroy()")) : e && s.adShowTimes++,
                    null == Global.bannerAd && (s.adShowTimes = 0, Global.bannerAd = wx.createBannerAd({
                        adUnitId: t,
                        style: {
                            left: .5 * tywx.SystemInfo.wxSystemInfo.screenWidth - i,
                            top: 0,
                            width: 300
                        }
                    })), Global.bannerAd.onError(function (e) {
                        console.log("Global.bannerAd err" + e), Global.bannerAd && (Global.bannerAd.destroy(),
                            Global.bannerAd = null);
                    }), function () {
                        if (Global.bannerAd) {
                            var t = "selectScene" == SceneHelper.getCurSceneName() || SceneHelper.getCurScene() && SceneHelper.getCurScene().getComponent("TableController") && SceneHelper.getCurScene().getComponent("TableController").hadShowResult && Global.tableModel.isInGameScene();
                            e && t && 0 == Global.UIPopupManager.getPopupList().length && 0 == Global.UIPopupManager.getPopupHideList().length ? Global.bannerAd.show().then(function () {
                                console.log("banner 广告显示"), Global.bannerAd.style.top = null != n ? n : 0, null != o ? Global.bannerAd.style.left = o : (Global.bannerAd.style.left = .5 * tywx.SystemInfo.wxSystemInfo.screenWidth - i,
                                    console.error("banner 广告显示", Global.bannerAd.style.left));
                            }) : Global.bannerAd.hide();
                        }
                    }();
                } catch (e) {
                    console.log("wx.createBannerAd error"), console.log(e);
                }
            },
            showGameClubBtn: function (e, t) {
                if (tywx.IsWechatPlatform()) try {
                    var n = tywx.UserInfo.sdkVersion;
                    if (console.log("showGameClubBtn compare version:", Global.gameClubButton, n, "2.0.3", this.compareVersion(n, "2.0.3")),
                    this.compareVersion(n, "2.0.3") <= 0) return;
                    if (!Global.gameClubButton) {
                        var o = tywx.SystemInfo.wxSystemInfo.screenWidth, i = cc.winSize.width / o;
                        if (!t) return void console.error("targetNode is ", t);
                        var a = t.getComponent(cc.Widget);
                        a && a.updateAlignment();
                        var r = t.getPosition(), s = t.parent.convertToWorldSpaceAR(r),
                            l = cc.winSize.height - 30 - s.y, c = s.x - 15;
                        Global.gameClubButton = wx.createGameClubButton({
                            icon: "light",
                            style: {
                                left: c / i,
                                top: l / i,
                                width: 30,
                                height: 30
                            }
                        });
                    }
                    Global.gameClubButton && (e && "homeScene" == SceneHelper.getCurSceneName() && 0 == Global.UIPopupManager.getPopupList().length && 0 == Global.UIPopupManager.getPopupHideList().length ? Global.gameClubButton.show() : Global.gameClubButton.hide());
                } catch (e) {
                    return void console.error("showGameClubBtn error:", e);
                }
            },
            showReconnectAlert: function (e, t, n, o) {
                if (Global.notificationCenter.emit(Global.eventName.MSG_OPERATE_RECONNECT_MASK, !1),
                Global.persistNodeComps && Global.persistNodeComps.node) {
                    var i = {
                        text: e,
                        confirmText: t,
                        confirmSp: n,
                        confirmCallback: function () {
                            Global.notificationCenter.emit(Global.eventName.MSG_OPERATE_RECONNECT_MASK, !0),
                            o && o();
                        },
                        needCloseBtn: !1,
                        parent: Global.persistNodeComps.node,
                        isPersist: !0
                    };
                    Global.UIPopupManager.alert(i);
                } else Global.notificationCenter.emit(Global.eventName.MSG_OPERATE_RECONNECT_MASK, !0),
                o && o();
            },
            getMoneyStringWithCoupons: function (e) {
                return (e / 100).toFixed(2) + "";
            },
            BILog: function (e) {
                if (cc.sys.platform == cc.sys.WECHAT_GAME) {
                    var t = Global.config.eventId, n = Global.config.rec_type;
                    if (!tywx.SystemInfo.wxSystemInfo) return void console.error("tywx.SystemInfo.wxSystemInfo is ", tywx.SystemInfo.wxSystemInfo);
                    var o, i, a, r, s, l = Global.config.bilogUrl, c = tywx.SystemInfo.wxSystemInfo;
                    o = c.DeviceId || 888, i = tywx.StateInfo.networkType || "wifi888", a = c.DeviceSIM || 888,
                        r = c.model, s = c.brand;
                    var d = cc.sys.now(), u = Global.userProfile.getUserId(), h = Global.config.CLIENTID,
                        f = Global.config.GAMEID,
                        p = Global.config.cloudId + "\t" + n + "\t" + d + "\t110\t0\t" + t + "\t" + u + "\t" + f + "\t" + h + "\t" + o + "\t192.168.1.0\t" + i + "\t" + s + "\t" + r + "\t" + a;
                    if (e && e.length > 0) for (var g = 0; g < e.length; g++) p = p + "\t" + e[g];
                    Global.SDK.requestBILog(l, p);
                }
            },
            getNumInString: function (e) {
                return null == e || void 0 == e ? 0 : e.replace(/[^0-9]/gi, "");
            },
            getFixedTwoNum: function (e) {
                var t = Math.round(100 * e) / 100, n = (t = t.toFixed(2)).split(".");
                return n[1] >= 10 ? n[1] : n[1].split("0")[1];
            },
            showToast: function (e, t) {
                var n = new cc.Node();
                n.name = "_item";
                var o = n.addComponent(cc.Label);
                o.string = e, o.font = 20;
                var i = cc.director.getScene();
                i && (i.addChild(n), n.setPosition(cc.v2(cc.winSize.width / 2, cc.winSize.height / 2))),
                    o.scheduleOnce(function () {
                        n && n.destroy();
                    }, t);
            },
            showNodeCommon: function (e, t) {
                var n = new cc.Node(), o = n.addComponent(cc.Label);
                o.string = "", cc.loader.loadRes("prefabs/nodeCommon", function (t, o) {
                    var i = cc.instantiate(o);
                    Global.utils.searchComp(i, "tip", cc.Label).string = e, n && cc.isValid(n) && i && cc.isValid(i) ? n.addChild(i) : console.error("showNodeCommon: item newNode cc.isValid");
                });
                var i = cc.director.getScene();
                if (i) {
                    var a = i.getChildByName("toastNode");
                    a && cc.isValid(a) && (a.removeFromParent(), a.destroy()), i.addChild(n, 2, "toastNode"),
                        n.setPosition(cc.v2(cc.winSize.width / 2, cc.winSize.height / 2 - 80));
                }
                o.scheduleOnce(function () {
                    n && (n.destroy(), n = null);
                }, t);
            },
            parseLocInfo: function (e) {
                if ("string" == typeof e) {
                    var t = e.split("."), n = parseInt(t[0]), o = parseInt(t[1]);
                    return [n, o, parseInt(t[2]), parseInt(t[3]), this._getPlayModeByRoomIdOrTableId(o)];
                }
                return null;
            },
            _getPlayModeByRoomIdOrTableId: function (e) {
                var t = null, n = e + "";
                if (n && n.length >= 4) {
                    var o = n.substring(0, 4);
                    console.log("_getPlayModeByRoomIdOrTableId _roomIdOrTableId:", n, o), o == Global.config.GAMEID_NORMAL + "1" ? t = Global.config.playModel.XUEZHAN : o == Global.config.GAMEID_NORMAL + "2" ? t = Global.config.playModel.XUELIU : o == Global.config.GAMEID_ERREN + "1" ? t = Global.config.playModel.ERREN : o == Global.config.GAMEID_ERRENQUICK + "1" && (t = Global.config.playModel.ERRENQUICK);
                }
                return t;
            },
            randomInt: function (e, t) {
                return Math.floor(Math.random() * (t - e + 1)) + e;
            },
            showTipsCallback: function (e) {
                cc.loader.loadRes("prefabs/commTips", function (t, n) {
                    var o = cc.instantiate(n), i = cc.director.getScene();
                    i && o && (i.addChild(o, 10), o.setPosition(cc.v2(cc.winSize.width / 2, cc.winSize.height / 2)),
                        Global.notificationCenter.emit(Global.eventName.GAME_UPDATE_COMMTIPS_STRING, e));
                });
            },
            showWaitting: function () {
                var e = this;
                this.isHideWaitting = !1;
                var t = function (t) {
                    var n = cc.instantiate(t), o = cc.director.getScene();
                    if (o && cc.isValid(o) && n && cc.isValid(n) && 0 == e.isHideWaitting) {
                        e.hideWaitting(), o.addChild(n, 101);
                        var i = Global.utils.searchNode(n, "spIconBg"), a = Global.utils.searchNode(n, "spTips"),
                            r = Global.utils.searchNode(n, "spBg"), s = cc.callFunc(function () {
                                i && a && r && (i.active = !0, a.active = !0, r.opacity = 110);
                            }.bind(this));
                        n.runAction(cc.sequence(cc.delayTime(.5), s, cc.delayTime(10), cc.removeSelf()));
                    }
                }.bind(this), n = cc.loader.getRes("prefabs/nodeWaitting", cc.Prefab);
                n ? t(n) : cc.loader.loadRes("prefabs/nodeWaitting", function (e, n) {
                    t(n);
                });
            },
            hideWaitting: function () {
                var e = cc.director.getScene();
                if (e && cc.isValid(e)) {
                    var t = e.getChildByName("nodeWaitting");
                    t && (t.removeFromParent(!0), t.destroy()), this.isHideWaitting = !0;
                }
            },
            formatNum: function (e, t) {
                t = t > 0 && t <= 20 ? t : 2;
                for (var n = (e = parseFloat((e + "").replace(/[^\d\.-]/g, "")).toFixed(t) + "").split(".")[0].split("").reverse(), o = e.split(".")[1], i = "", a = 0; a < n.length; a++) i += n[a] + ((a + 1) % 3 == 0 && a + 1 != n.length ? "," : "");
                return i.split("").reverse().join("") + "." + o;
            },
            getFixString: function (e, t) {
                if (!e || t < 0 || "string" != typeof e) return "";
                for (var n = 0, o = 0; o < e.length; o++) if (/[\u0000-\u00ff]/g.test(e.charAt(o)) ? n += .5 : /[\u4e00-\u9fa5]/g.test(e.charAt(o)) ? n += 1 : /[\uff00-\uffff]/g.test(e.charAt(o)) && (n += 1),
                n > t) {
                    e = e.slice(0, o - 1) + "...";
                    break;
                }
                return e;
            },
            exchangeToWan: function (e) {
                var t = e;
                t < 0 && (t = -t);
                var n = "";
                if (t > 99999999) {
                    var o = t / 1e8;
                    return n = this._subNum(o), e < 0 && (n = "-" + n), n + "亿";
                }
                if (t > 99999) {
                    o = t / 1e4;
                    return n = this._subNum(o), e < 0 && (n = "-" + n), n + "万";
                }
                return e + "";
            },
            exchangeToWan2: function (e) {
                var t = e;
                t < 0 && (t = -t);
                var n = "";
                if (t > 99999999) {
                    var o = t / 1e8;
                    return n = this._subNum(o), e < 0 && (n = "-" + n), n + "亿";
                }
                if (t > 9999) {
                    o = t / 1e4;
                    return n = this._subNum(o), e < 0 && (n = "-" + n), n + "万";
                }
                return e;
            },
            _subNum: function (e) {
                var t = e.toString().split(".");
                if (1 == t.length) return t[0];
                var n = 4 - t[0].length;
                if (n <= 0) return t[0];
                if (2 == n) {
                    var o = t[1].substr(0, 1);
                    return "0" == (i = t[1].substr(1, 1)) ? "0" == o ? t[0] : t[0] + "." + o : t[0] + "." + o + i;
                }
                if (1 == n) return "0" == (o = t[1].substr(0, 1)) ? t[0] : t[0] + "." + o;
                if (3 == n) {
                    o = t[1].substr(0, 1);
                    var i = t[1].substr(1, 1), a = t[1].substr(2, 1);
                    return "0" == a ? "0" == i ? "0" == o ? t[0] : t[0] + "." + o : t[0] + "." + o + i : t[0] + "." + o + i + a;
                }
            },
            encode: function (e) {
                var t, n, o, i, a, r, s, l = "", c = 0;
                for (e = this._utf8_encode(e); c < e.length;) i = (t = e.charCodeAt(c++)) >> 2,
                    a = (3 & t) << 4 | (n = e.charCodeAt(c++)) >> 4, r = (15 & n) << 2 | (o = e.charCodeAt(c++)) >> 6,
                    s = 63 & o, isNaN(n) ? r = s = 64 : isNaN(o) && (s = 64), l = l + this._keyStr.charAt(i) + this._keyStr.charAt(a) + this._keyStr.charAt(r) + this._keyStr.charAt(s);
                return l;
            },
            decode: function (e) {
                var t, n, o, i, a, r, s = "", l = 0;
                for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length;) t = this._keyStr.indexOf(e.charAt(l++)) << 2 | (i = this._keyStr.indexOf(e.charAt(l++))) >> 4,
                    n = (15 & i) << 4 | (a = this._keyStr.indexOf(e.charAt(l++))) >> 2, o = (3 & a) << 6 | (r = this._keyStr.indexOf(e.charAt(l++))),
                    s += String.fromCharCode(t), 64 != a && (s += String.fromCharCode(n)), 64 != r && (s += String.fromCharCode(o));
                return s = this._utf8_decode(s);
            },
            _utf8_encode: function (e) {
                e = e.replace(/\r\n/g, "\n");
                for (var t = "", n = 0; n < e.length; n++) {
                    var o = e.charCodeAt(n);
                    o < 128 ? t += String.fromCharCode(o) : o > 127 && o < 2048 ? (t += String.fromCharCode(o >> 6 | 192),
                        t += String.fromCharCode(63 & o | 128)) : (t += String.fromCharCode(o >> 12 | 224),
                        t += String.fromCharCode(o >> 6 & 63 | 128), t += String.fromCharCode(63 & o | 128));
                }
                return t;
            },
            _utf8_decode: function (e) {
                for (var t = "", n = 0, o = 0, i = 0, a = 0; n < e.length;) (o = e.charCodeAt(n)) < 128 ? (t += String.fromCharCode(o),
                    n++) : o > 191 && o < 224 ? (i = e.charCodeAt(n + 1), t += String.fromCharCode((31 & o) << 6 | 63 & i),
                    n += 2) : (i = e.charCodeAt(n + 1), a = e.charCodeAt(n + 2), t += String.fromCharCode((15 & o) << 12 | (63 & i) << 6 | 63 & a),
                    n += 3);
                return t;
            },
            decodeMessageTy: function (e) {
                if ("undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer) {
                    for (var t = new Uint8Array(e), n = "", o = 0, i = t.length; o < i; o++) {
                        n += String.fromCharCode(t[o]);
                    }
                    return n;
                }
                var a = (e = this.base64decodeRawTy(e)).slice(0, 4);
                for (o = 0, i = (e = e.slice(4)).length; o < i; o++) {
                    var r = e[o];
                    r ^= a[o % 4], e[o] = r;
                }
                return this._ty_utf8_decode(e);
            },
            base64decodeRawTy: function (e) {
                for (var t, n, o, i, a, r, s = 0, l = (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "")).length, c = []; s < l;) t = this._keyStr.indexOf(e.charAt(s++)) << 2 | (i = this._keyStr.indexOf(e.charAt(s++))) >> 4,
                    n = (15 & i) << 4 | (a = this._keyStr.indexOf(e.charAt(s++))) >> 2, o = (3 & a) << 6 | (r = this._keyStr.indexOf(e.charAt(s++))),
                    c.push(t), 64 != a && c.push(n), 64 != r && c.push(o);
                return c;
            },
            _ty_utf8_decode: function (e) {
                for (var t, n = "", o = 0, i = t = 0, a = 0, r = e.length; o < r;) (i = e[o]) < 128 ? (n += String.fromCharCode(i),
                    o++) : i > 191 && i < 224 ? (t = e[o + 1], n += String.fromCharCode((31 & i) << 6 | 63 & t),
                    o += 2) : (t = e[o + 1], a = e[o + 2], n += String.fromCharCode((15 & i) << 12 | (63 & t) << 6 | 63 & a),
                    o += 3);
                return n;
            },
            releaseAllDeps: function (e) {
                e.forEach(function (e) {
                    cc.loader.release(e);
                });
            },
            getDependsRecursively: function (e) {
                var t = Global.UIPopupManager._getPopupByUrl(e);
                return t && t.url ? cc.loader.getDependsRecursively(t.url) : null;
            },
            releasePanel: function (e) {
                var t = this.getDependsRecursively(e);
                t ? this.releaseAllDeps(t) : console.warn("releasePanel error!");
            },
            calcNodeBounding: function (e, t) {
                var n = t.width * t.anchorX, o = t.height * t.anchorY, i = new cc.Vec2(-n, -o),
                    a = new cc.Vec2(t.width - n, t.height - o);
                return i = t._sgNode.convertToWorldSpace(i), a = t._sgNode.convertToWorldSpace(a),
                    i = e._sgNode.convertToNodeSpace(i), a = e._sgNode.convertToNodeSpace(a), new cc.Rect(i.x, i.y, a.x - i.x, a.y - i.y);
            },
            calcNodeCenter: function (e, t) {
                var n = t.width * t.anchorX, o = t.height * t.anchorY, i = new cc.Vec2(-n, -o),
                    a = new cc.Vec2(t.width - n, t.height - o), r = i.add(a).div(2);
                return r = t._sgNode.convertToWorldSpace(r), r = e._sgNode.convertToNodeSpace(r),
                    new cc.Vec2(r.x, r.y);
            },
            calcWindowCenter: function (e) {
                var t = cc.p(cc.winSize.width / 2, cc.winSize.height / 2);
                return t = e._sgNode.convertToNodeSpace(t), cc.p(t.x, t.y);
            },
            adaptTipWidth: function (e, t) {
                var n = t.node.width;
                e.node.width = n + e.getInsetLeft() + e.getInsetRight();
            },
            cutString: function (e, t) {
                if (!e) return "";
                for (var n = "", o = 0, i = e.length, a = 0; a < i; a++) {
                    var r = e.charAt(a);
                    if (o++, (e.charCodeAt(a) > 127 || 94 === e.charCodeAt(a)) && o++, o > t) return n = n.concat("...");
                    n = n.concat(r);
                }
                return o <= t ? e : void 0;
            },
            searchComp: function (e, t, n) {
                var o = this.searchNode(e, t);
                if (!o) return null;
                var i = o.getComponent(n);
                return i || null;
            },
            searchNode: function (e, t, n) {
                function o(e, t) {
                    for (var n = [[e]], o = 0; o < n.length; ++o) for (var i = n[o], a = 0; a < i.length; ++a) {
                        if ((e = i[a]).name === t) return e;
                        n.push(e.children);
                    }
                    return null;
                }

                for (var i = e, a = 1; a < arguments.length && i; ++a) i = o(i, arguments[a]);
                return i;
            },
            triggerGC: function () {
                cc.sys.platform == cc.sys.WECHAT_GAME && cc.sys.os == cc.sys.OS_ANDROID && (console.error("triggerGC"),
                window.wx && window.wx.triggerGC && window.wx.triggerGC());
            },
            isWechatGame: function () {
                return window.wx;
            },
            getMemoriesStats: function () {
                var e = 0, t = cc.textureCache._textures;
                for (var n in t) {
                    var o = t[n];
                    0, e += o.getPixelWidth() * o.getPixelHeight() * 4;
                }
                var i = cc.textureCache._textureColorsCache;
                for (var a in i) {
                    var r = i[a];
                    for (var s in r) {
                        var l = r[s];
                        0, e += l.width * l.height * 4;
                    }
                }
                return (e / 1048576).toFixed(2);
            },
            loadHead: function (e, t, n) {
                if (t.length < 5) n && (e.spriteFrame = n); else {
                    var i = cc.loader.getRes(t, cc.SpriteFrame);
                    if (i) return a(i);
                    (0, o.safeLoad)({
                        url: t,
                        type: "png"
                    }, function (t, o) {
                        t || !o ? n && (e.spriteFrame = n) : a(o);
                    });
                }

                function a(t) {
                    e.spriteFrame && e.spriteFrame.getTexture() === t || (e.spriteFrame = new cc.SpriteFrame(t));
                }
            },
            itemFly: function (e) {
                var t = e.startNode, n = e.startOffset || cc.v2(0, 0), o = e.startdelay || 0, i = e.endNode,
                    a = e.endOffset || cc.v2(0, 0), r = e.duration, s = e.spriteFrame,
                    l = void 0 == e.stayDuration ? 0 : e.stayDuration,
                    c = void 0 == e.parentNode ? cc.find("Canvas") : e.parentNode, d = e.callback, u = e.followNode,
                    h = e.startScale || 1, f = e.endScale || 1, p = void 0 == e.isScaleBack || e.isScaleBack,
                    g = void 0 != e.isSpeedEase && e.isSpeedEase, b = void 0 == e.isDirection || e.isDirection,
                    m = e.directionX || -1, _ = e.referAngle || Math.PI / 6,
                    y = void 0 != e.isBezierEase && e.isBezierEase, S = void 0 != e.isRotate && e.isRotate,
                    I = void 0 != e.isHasCoinParticle && e.isHasCoinParticle, v = new cc.Node();
                v.name = "_item", s && Global.spriteAtlas.setSpriteFrame(v.addComponent(cc.Sprite), "Texture/chat_effect_emotion", s),
                    v.scale = h, c.addChild(v), cc.log("++++++++++" + o);
                var C = t.convertToWorldSpaceAR(cc.p(0, 0)), G = cc.find("Canvas").convertToNodeSpaceAR(C), T = n,
                    w = cc.v2(G.x + T.x, G.y + T.y);
                v.setPosition(w), cc.log("originV:" + w);
                var E = i.convertToWorldSpaceAR(cc.p(0, 0)), A = cc.find("Canvas").convertToNodeSpaceAR(E), N = a,
                    M = cc.v2(A.x + N.x, A.y + N.y);
                if (cc.log("toVec:" + M), I) for (var P = 0; P < 3; P++) {
                    var R = UH.UiManager.createFlash();
                    u ? R.setPosition(cc.pAdd(u.getPosition(), cc.p(this.randomInt(-10, 10), this.randomInt(-10, 10)))) : R.setPosition(cc.pAdd(cc.Vec2.ZERO, cc.p(this.randomInt(-10, 10), this.randomInt(-10, 10)))),
                        v.addChild(R);
                }
                var k = null, x = null, D = null;
                if (D = S ? cc.rotateBy(r, 360) : cc.callFunc(function () {
                }), p) {
                    var L = cc.scaleTo(r / 2, f), O = cc.scaleTo(r / 2, h);
                    x = new cc.Sequence(L, O);
                } else x = cc.scaleTo(r, f);
                var U, B = cc.callFunc(function () {
                    cc.log("finished+"), v.destroy(), d && d();
                }, v, null);
                cc.log("bezier---");
                var F = w, H = M, W = F.x - H.x <= 0 ? 1 : -1, j = F.y - H.y <= 0 ? 1 : -1, q = cc.pDistance(F, H),
                    Y = Math.tan(_) * q / 2, K = cc.p((F.x + H.x) / 2, (F.y + H.y) / 2),
                    V = Math.abs(H.y - F.y) / q * Y, z = Math.abs(H.x - F.x) / q * Y, Q = cc.p(K.x + V, K.y + z);
                1 === m ? j * W == 1 ? Q = cc.p(K.x - V, K.y + z) : j * W == -1 && (Q = cc.p(K.x + V, K.y + z)) : j * W == 1 ? Q = cc.p(K.x + V, K.y - z) : j * W == -1 && (Q = cc.p(K.x - V, K.y - z)),
                    U = [Q, Q, H], b ? g ? (k = cc.moveTo(r, M).easing(cc.easeIn(3)), cc.log("cc.easeInOut")) : k = cc.moveTo(r, M) : k = y ? cc.bezierTo(r, U).easing(cc.easeIn(3)) : cc.bezierTo(r, U);
                var J = function () {
                    var e = new cc.Sequence(k, cc.delayTime(l), B), t = new cc.Spawn(e, x, D);
                    v.runAction(t);
                };
                u && (u.parent = v), s ? v.getComponent(cc.Sprite).scheduleOnce(function () {
                    J();
                }, o) : u ? u.getComponent(cc.Animation).scheduleOnce(function () {
                    J();
                }, o) : J();
            },
            compareVersion: function (e, t) {
                e = e.split("."), t = t.split(".");
                for (var n = Math.max(e.length, t.length); e.length < n;) e.push("0");
                for (; t.length < n;) t.push("0");
                for (var o = 0; o < n; o++) {
                    var i = parseInt(e[o]), a = parseInt(t[o]);
                    if (i > a) return 1;
                    if (i < a) return -1;
                }
                return 0;
            },
            showViewAd: function (e, t, n) {
                try {
                    if (e = void 0 == e ? Global.config.adUnitId : e, console.log("showViewAd: adUnitId= ", e),
                        (i = this).isSuccess = !1, i.adSuccessCallBack = t, i.adfailCallBack = n, !tywx.IsWechatPlatform()) return;
                    var o = function () {
                        Global.videoAd && (Global.videoAd = null), Global.videoAd = wx.createRewardedVideoAd(e);
                    };
                    o();
                    var i = this;
                    Global.videoAd.onError(function (e) {
                        cc.error(e), i.errorCount++, i.errorCount > 3 || o();
                    }), Global.videoAd && Global.videoAd.load().then(function () {
                        return Global.videoAd.show();
                    }).catch(function (e) {
                        return console.log(e.errMsg);
                    }), Global.videoAd && Global.videoAd.onClose(function (e) {
                        if (e && e.isEnded || void 0 === e) {
                            if (i.isSuccess) return;
                            cc.warn("正常播放结束，可以下发游戏奖励"), i.adSuccessCallBack && (i.isSuccess = !0, i.adSuccessCallBack());
                        } else cc.warn("播放中途退出，不下发游戏奖励"), i.adfailCallBack && i.adfailCallBack();
                    });
                } catch (e) {
                    console.log("wx.createRewardedVideoAd error"), console.log(e);
                }
            },
            showAdCross: function (e) {
                var t = tywx.AdManager.getAdNodeList();
                if (t.length) for (var n = 0; n < t.length; n++) e && "homeScene" == SceneHelper.getCurSceneName() && 0 == Global.UIPopupManager.getPopupList().length && 0 == Global.UIPopupManager.getPopupHideList().length ? t[n].showAdNode() : t[n].hideAdNode();
            },
            isThisCityBlocked: function () {
                var e = Global.configCdn.getUISwitchConf();
                if (e && e.blockedCityList && e.blockedCityList.length > 0) {
                    var t = tywx.AdManager.getUserCityInfo();
                    for (var n in console.log("isThisCityBlocked: currCityName= ", t), e.blockedCityList) if (t === e.blockedCityList[n]) return console.log("isThisCityBlocked: i= ", n),
                        !0;
                }
                return !1;
            },
            getOffsetByPhoneType: function () {
                var e = 185, t = tywx.UserInfo.model;
                return t && (t.indexOf("iPhone X") >= 0 ? e = 190 : t.indexOf("iPhone 5") >= 0 ? e = 180 : t.indexOf("iPhone 6") >= 0 ? e = 180 : t.indexOf("iPhone 6 Plus") >= 0 ? e = 174 : t.indexOf("iPhone 7") >= 0 ? e = 179 : t.indexOf("iPhone 7 Plus") >= 0 && (e = 177)),
                    e;
            },
            showRedPacketWinLucky: function (e) {
                Global.configCdn.getUISwitch() ? e ? Global.UIPopupManager.addPopup("PopupPanel/Panel_Reward_RotateLuck", function (e) {
                }, null, null, e) : Global.UIPopupManager.addPopup("PopupPanel/Panel_Reward_RotateLuck", function (e) {
                }) : Global.utils.showNodeCommon("金币不够了，去充值吧～", 2);
            }
        },  module.exports = i
    }